package com.daotingli.springdemo;

import com.daotingli.springdemo.Controller.Config.Config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class SpringDemoApplication {

    @Autowired
    private Config config;

    public static void main(String[] args) {
        System.out.println("开始启动...");
        ConfigurableApplicationContext context = SpringApplication.run(SpringDemoApplication.class, args);
        System.out.println("启动中...");
        SpringDemoApplication app=context.getBean(SpringDemoApplication.class);
        System.out.println("启动完成");
        System.out.println("Application Name: " + app.config.getAppName());
        System.out.println("Application Port: " + app.config.getPort());
        System.out.println("访问链接 :http://localhost:"+app.config.getPort());



    }

}
